export default (onlineListRef, interviewersArr) => {
    // 开始录音前轮询查询未到达页面的面试官
    const runUnStartList = () =>
        new Promise(resolve => {
            const notOnlineArr = [];
            interviewersArr.forEach(item => {
                if (!onlineListRef.current.includes(item.employeeCode)) {
                    notOnlineArr.push(item.employeeName);
                }
            });
            resolve(notOnlineArr);
            return notOnlineArr;
        });

    const onBeforeStart = () =>
        new Promise(resolve => {
            runUnStartList().then(unStartList => {
                resolve(unStartList);
                return unStartList;
            });
        });

    return [onBeforeStart];
};
